package cn.com.bluemoon.daps.sync.vo.model2prod;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Jarod.Kong
 * @date 2021/7/2 10:03
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(description = "发布同步-同步预发布/生产")
public class SyncPublishInfoOut implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据唯一id")
    private String taskId;

    @ApiModelProperty(value = "变更单号")
    private String changeOrder;

    @ApiModelProperty(value = "模型名称")
    private String modelName;

    @ApiModelProperty(value = "数据库")
    private String dbname;

    @ApiModelProperty(value = "IP")
    private String host;

    @ApiModelProperty(value = "端口")
    private Integer port;

    @ApiModelProperty(value = "申请人")
    private String applicationBy;

    @ApiModelProperty(value = "申请时间", example = "1970-01-01 00:00:00")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private LocalDateTime applicationTime;

    @ApiModelProperty(value = "审批人")
    private String verifyBy;

    @ApiModelProperty(value = "描述信息")
    private String changeDesc;

    @ApiModelProperty(value = "执行人")
    private String syncBy;

    @ApiModelProperty("同步状态，0：未同步、1：同步中、2：已同步、3：同步失败，")
    private Integer syncStatus;

    @ApiModelProperty(value = "同步时间", example = "1970-01-01 00:00:00")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private LocalDateTime syncTime;

    @ApiModelProperty(value = "未执行DDL")
    private List<String> unSyncDdls;

    @ApiModelProperty(value = "已执行DDL")
    private List<String> syncDdls;

    @ApiModelProperty("是否可以执行同步, true可以执行，false不可执行")
    private Boolean canSync;


}
